home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
Tutorial
/
Cookbook
/
37.Miter
/
MitreView.m
< prev
next >
Wrap
Text File
|
1995-06-12
|
1KB
|
59 lines
/* Generated by Interface Builder */
#import "MitreView.h"
#include <dpsclient/wraps.h>
// #include <appkit/Control.h>
#include <appkit/Matrix.h>
@implementation MitreView
- lineJoinType:sender
{
lineJoin = [sender selectedRow];
[self display];
return self;
}
- lineCapType:sender
{
lineCap = [sender selectedRow];
[self display];
return self;
}
- drawSelf:(NXRect*)r :(int)c
{
NXEraseRect(&bounds);
PSsetgray(NX_BLACK);
PSsetlinewidth(50.0);
PSsetlinejoin(lineJoin);
PSsetlinecap(lineCap);
PSnewpath();
PSmoveto(400.0, 50.0);
PSlineto(100.0, 50.0);
PSlineto(400.0, 250.0);
PSstroke();
// draw the thin white line on top
PSsetgray(NX_WHITE);
PSsetlinewidth(1.0);
PSnewpath();
PSmoveto(400.0, 50.0);
PSlineto(100.0, 50.0);
PSlineto(400.0, 250.0);
PSstroke();
PSnewpath();
PSarc(400.0, 50.0, 4.0, 0.0, 360.0);
PSmoveto(100.0, 50.0);
PSarc(100.0, 50.0, 4.0, 0.0, 360.0);
PSmoveto(400.0, 250.0);
PSarc(400.0, 250.0, 4.0, 0.0, 360.0);
PSfill();
return self;
}
@end